<?
/*
 *   Pmail easy way to send emails
 *   Copyright (C) 2009  Felipe Theodoro Gonçalves (www.ftgoncalves.com)
 *
 *   This program is free software: you can redistribute it and/or modify
 *	 it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
?>
<div id="page">
	<h2>Send a message</h2>
	<form action="<?= $html->url(array('plugin' => 'pmail', 'controller' => 'mails', 'action' => 'index')) ?>" method="post" enctype="application/x-www-form-urlencoded">
		<fieldset>
			<legend><?= __d('pmail', 'Send email to'); ?></legend>
			<p>
				<label for="groups"><?= __d('pmail', 'Groups'); ?> (<?= __d('pmail', 'multiple select'); ?>)</label>
				<br/>
				<?= $form->select('Pmail.to', $groups, null, array('size' => 6, 'class' => 'select_big', 'multiple' => true), false) ?>
				<br/>
				<?= $html->link($html->image('/pmail/img/adicionar.gif', array('border' => 0)), 'javascript:void(0);', array('id' => 'view_more', 'alt' => 'add more'), false, false); ?> <?= __d('pmail', 'more contacts'); ?>
			</p>
			<p class="hide" id="more">
				<label for="to"><?= __d('pmail', 'More email'); ?> (<?= __d('pmail', 'comma-separated'); ?>)</label>
				<br/>
				<?= $form->text('Pmail.emails', array('class' => 'big')); ?>
			</p>
			<p>
				<label for="mail"><?= __d('pmail', 'Mail'); ?></label>
				<br/>
				<?= $form->select('Pmail.email', $emails, null, array('size' => 10, 'class' => 'select_big'), false) ?>
			</p>
			<p>
				<?= $form->submit(__d('pmail', 'send', true), array('value' => 'Send a e-mail', 'class' => 'button')) ?>
			</p>
		</fieldset>
	</form>
</div>
<div id="sidebar">
	<h4><?= __d('pmail', 'Coments'); ?></h4>
	<p><?= __d('pmail', 'Send the e-mails saved to the groups'); ?>.</p>
	<?= $this->requestAction('/pmail/mails/menu'); ?>
	<?= $this->renderElement('recommended/links'); ?>
</div>
<div class="clear"></div>
<script type="text/javascript">
	$('#view_more').click(function(){
		$('#more').toggle();
	});
</script>